import { forwardRef, Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { MenuModule } from '../system/menu/menu.module';
import { ParamConfigModule } from '../system/param-config/param-config.module';

import { RoleModule } from '../system/role/role.module';

import { UserController } from './user.controller';
import { UserEntity } from './user.entity';
import { UserService } from './user.service';
import { UserWechatEntity } from './user-wechat/user-wechat.entity';
import { UserAdminEntity } from './user-admin/user-admin.entity';
import { UserAdminService } from './user-admin/user-admin.service';
import { UserWechatService } from './user-wechat/user-wechat.service';
import { TenantModule } from '../tenant/tenant.module';
import { PointsModule } from '../points/points.module';
import { CategoryDiseaseModule } from '../category-disease/category-disease.module';

const providers = [UserService, UserAdminService, UserWechatService];

@Module({
  imports: [
    forwardRef(() => TenantModule),
    TypeOrmModule.forFeature([UserEntity, UserWechatEntity, UserAdminEntity]),
    RoleModule,
    MenuModule,
    ParamConfigModule,
    PointsModule,
    CategoryDiseaseModule,
  ],
  controllers: [UserController],
  providers: [...providers],
  exports: [TypeOrmModule, ...providers],
})
export class UserModule {}
